[mirrors]
http://download.oracle.com/berkeley-db/db-6.1.26.tar.gz

[vars]
filesize=37495772
sha512=2590ee3d9e30e6eaeb350edbc2fa7400582c0b520177fe0a3a57a966573268e18ad10b1dc6dee3fb1be9c93ac6f96f848c120793eaf873562464edd125cff4d4
desc='library to interface with berkeley (file-based) databases'

[deps]

[build]
patch -p1 < "$K"/bdb-configure.patch
cd build_unix
mv ../config.cache .

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CFLAGS="-D_GNU_SOURCE" ../dist/configure -C \
    --prefix="$butch_prefix" --enable-compat185 $xconfflags \
    --enable-shared --enable-static --enable-dbm \
    db_cv_clock_monotonic=yes db_cv_build_sequence=yes db_cv_mmap_extend=yes

sed -i 's/^install_docs:/install_docs:\n\ttrue\ninstall_crap:/' Makefile
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
